package test;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;

public class test3 {
	public static void main(String[] args) throws InterruptedException {
		String a = "[我是天才，aaaa。爱爱\\爱,xxx.`|| 1	1111\nn22222?~\"";
		// String removeSpecialChar = StrFormat.removeSpecialChar(a);
		// System.out.println(removeSpecialChar);
		// StringBuffer sb=new StringBuffer("ssssiiiii");
		// System.out.println(sb.delete(0, sb.length()-1).toString());
		// ArrayList l=new ArrayList<>();
		// System.out.println(l.isEmpty());
		final LinkedBlockingQueue<String> bq = new LinkedBlockingQueue<>();
		Thread th = new Thread(new Runnable() {

			@Override
			public void run() {
				// TODO Auto-generated method stub
				for (int i = 0; i < 20; i++) {
					try {
						bq.put(""+i);
					} catch (InterruptedException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
				}
			}
		});
		th.start();
		Thread.sleep(500);
		System.out.println(bq.size());
		while(bq.size()>2){
			System.out.println(bq.take());
		}
		System.out.println("xxxxx");
	}
}
